﻿namespace DimensionsHelper.LanguageService.Syntax;

// [ AreaName: ]
public abstract class MetadataArealObject : SyntaxNode
{
    private Identifier? _areaName;

    protected internal MetadataArealObject(SyntaxKinds kind, SyntaxNode? parent) :
        base(kind, parent)
    {
    }

    /// <summary>
    ///     地区定义名称
    /// </summary>
    public Identifier? AreaName => _areaName;


    public void Update(Identifier areaName)
    {
        SetChildNullableField(ref _areaName, Identifier.IsDefaultOrEmpty, areaName);
    }


    public override void AcceptVisitor<T>(SyntaxNodeVisitor<T> visitor)
    {
        Accept(visitor, AreaName);
    }
}